package cn.tedu.ba04;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;


@Aspect
public class MyAspect {



    @Before(value = "mypt()")
    public void myBefore(){
        System.out.println("前置通知");
    }

    @AfterReturning(value = "mypt()",returning ="res" )
    public void myAfterReturning(Object res){
        System.out.println("后置通知");
    }


    /*@Pointcut:当有多个切入点重复时，可以服用
        给切入点的别名，调用方法()
    * */
    @Pointcut(value = "execution(* cn.tedu.ba04.SomeServiceImpl.doSome(..))")
    private void mypt(){
        //无需方法体
    }
}
